Skip to content

fix warnings in jit builds#144817

Merged
Fidget-Spinner merged 3 commits intopython:mainfrom
chris-eibl:jit_warnings
Feb 14, 2026
Merged

fix warnings in jit builds#144817
Fidget-Spinner merged 3 commits intopython:mainfrom
chris-eibl:jit_warnings

Conversation

@chris-eibl
Copy link
Member

There are warnings in jit builds in CI and build bots.

return -1;
}
int old;
DWORD old;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incompatible pointer types passing 'int *' to parameter of type 'PDWORD' (aka 'unsigned long *') [-Wincompatible-pointer-types]

tracer->initial_state.executor = (_PyExecutorObject *)Py_XNewRef(current_executor);
tracer->initial_state.exit = exit;
tracer->initial_state.stack_depth = stack_pointer - _PyFrame_Stackbase(frame);
tracer->initial_state.stack_depth = (int)((uintptr_t)stack_pointer - (uintptr_t)_PyFrame_Stackbase(frame));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning C4244: '=': conversion from '__int64' to 'int', possible loss of data

depth = _PyUop_Caching[uop].entries[depth].output;
}
return write - output;
return (int)((uintptr_t)write - (uintptr_t)output);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning C4244: 'return': conversion from '__int64' to 'int', possible loss of data

#endif
for (int i = 4; i < 8; i++) {
if ((true_bits ^ false_bits) & (1 << i)) {
if ((true_bits ^ false_bits) & (uintptr_t)(1 << i)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below

warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits

}

op(_BINARY_OP_EXTEND, (left, right -- res, l, r)) {
op(_BINARY_OP_EXTEND, (descr/4, left, right -- res, l, r)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

descr/4 was missing here. The code generator "takes" it from bytecodes.c, hence the

PyObject *descr = (PyObject *)this_instr->operand0;

line was already in optimizer_cases.h without it.

The (void)descr; below then silences the unused warning.

break;
}
int returning_stacklevel = this_instr->operand1;
int returning_stacklevel = (int)this_instr->operand1;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below

warning C4244: 'initializing': conversion from 'uint64_t' to 'int', possible loss of data

long index = PyLong_AsLong(sym_get_const(ctx, sub_st));
assert(index >= 0);
int tuple_length = sym_tuple_length(tuple_st);
Py_ssize_t tuple_length = sym_tuple_length(tuple_st);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data

@chris-eibl chris-eibl marked this pull request as draft February 14, 2026 13:41
@Fidget-Spinner
Copy link
Member

Uh oh the tests are failing.

@chris-eibl
Copy link
Member Author

chris-eibl commented Feb 14, 2026

Uh oh the tests are failing.

Fixed.

@chris-eibl chris-eibl marked this pull request as ready for review February 14, 2026 16:58
@Fidget-Spinner Fidget-Spinner merged commit caac966 into python:main Feb 14, 2026
67 checks passed
@chris-eibl chris-eibl deleted the jit_warnings branch February 14, 2026 18:00
bkap123 pushed a commit to bkap123/cpython that referenced this pull request Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build The build process and cross-build skip issue skip news topic-JIT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants